<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page  isELIgnored="false"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/bootstrap.min.css" />

    <link href="<%=request.getContextPath()%>/assets/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <script src="assets/js/jquery-1.10.2.js"></script>
	<script  type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.min.js" ></script>
	<link href="assets/css/bootstrap-fileupload.min.css" rel="stylesheet" />
	<link href="assets/css/custom.css" rel="stylesheet" />
	 <link href="assets/css/basic.css" rel="stylesheet" />
	 <link rel="stylesheet" href="css/Orderfont.css"><link>
	  </head>
  
  <body>
               <div class="panel panel-info">
                        <div class="page-header">
		  		<h1><small>添加检查项目<i class="icon-double-angle-right"></i></small></h1>
			</div>
               <div class="panel-body">
                   <form method="post" role="form" action="InspectItemsController/addinspectsPost" class="form-horizontal" enctype="multipart/form-data">
                    
                     <%--项目名称--%>
              		<div class="form-group">
                        <label for="name" class="control-label col-sm-3">项目名称</label>
                        <div class="col-sm-6">
                        	<input class="form-control" type="text" name="name" id="name"> 
                        </div>
                     </div>  
                                 
                     <div class="form-group">
						<label class="col-sm-3 control-label no-padding-right"
							for="form-field-2">检查项目类别 </label>

						<div class="col-sm-9">
							<select id="FirstLevelInspectionItemId" name="FirstLevelInspectionItemId" >
								<option value="0">----请选择一级项目类别----</option>
								<c:forEach items="${firstLevelList}" var="item0">
									<option value="${item0.id}">${item0.secondLevelName}</option>
								</c:forEach>
							</select> 
							<select id="SecondLevelInspectionItemId" name="SecondLevelInspectionItemId" >
								<option value="-1">----请选择二级项目类别----</option>
							<c:forEach items="${firstLevelList}" var="item0">
								<!-- <select class="secondInspId" id="secondInspId"> -->
									<c:forEach items="${item0.secondLevelList}" var="item1">
										<option value="${item1.id}">${item1.secondLevelName}</option>
									</c:forEach>
								<!-- </select> -->
							</c:forEach>
						</select>
					</div>
				</div>
                                 
                                 <%--项目编号--%>
                          		<div class="form-group">
                                    <label for="landline" class="control-label col-sm-3">项目编号</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="number" id="number"> 
                                    </div>
                                 </div>   
                                 <%--检验方法 --%>
                          		<div class="form-group">
                                    <label for="fax" class="control-label col-sm-3">检验方法</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="inspectionMethod" id="inspectionMethod"> 
                                    </div>
                                 </div>                                                                              
                                 <%--收费标准 --%>
                          		<div class="form-group">
                                    <label for="feescale" class="control-label col-sm-3">收费标准</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="feescale" id="feescale"> 
                                    </div>
                                 </div>
                                 <%--出报告时间 --%>
                          		<div class="form-group">
                                    <label for="corporation" class="control-label col-sm-3">出报告时间</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="time" id="time"> 
                                    </div>
                                 </div>
                                 <%-- 样本量 --%>
                                 <div class="form-group">
                                    <label for="corporation" class="control-label col-sm-3">样本量</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="sampleSize" id="sampleSize"> 
                                    </div>
                                 </div> 
                                  <%--临床应用 --%>
                                  <div class="form-group">
                                    <label for="corporation" class="control-label col-sm-3">临床应用</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="clinicalApplication" id="clinicalApplication"> 
                                    </div>
                                 </div>  
                                                                         
                                 <%--样本稳定性 --%>
                                 <div class="form-group">
                                    <label for="corporation" class="control-label col-sm-3">样本稳定性</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="sampleStability" id="sampleStability"> 
                                    </div>
                                 </div>    
                                  <%--注释 --%>
                                 <div class="form-group">
                                    <label for="corporation" class="control-label col-sm-3">注释</label>
                                    <div class="col-sm-6">
                                    	<input class="form-control" type="text" name="notes" id="notes"> 
                                    </div>
                                 </div>  
                                        <!-- <button type="submit" class="btn btn-info" id="sm">提交</button> -->
								<div class=" clearfix form-actions">
									<div class="col-md-offset-2 col-xs-12 col-sm-7 col-md-9">
										<button class="btn btn-info" type="submit" id="sm">
											<i class="icon-ok bigger-110"></i> 提交
										</button>
									</div>
								</div>
                           </form>
                    	</div>
                    </div>

<script src="assets/js/bootstrap-fileupload.js"></script>

<script type="text/javascript" >
//类型 二级联动设置
	$(document).ready(function() {
		
		$("#FirstLevelInspectionItemId").change(function() {
			$("#FirstLevelInspectionItemId option").each(function(i, o) {
				if ($(this).attr("selected")) {
					$(".SecondLevelInspectionItemId").attr("name", "");
					$(".SecondLevelInspectionItemId").hide();
					$(".SecondLevelInspectionItemId").eq(i).show();
					$(".SecondLevelInspectionItemId").eq(i).attr("name", "SecondLevelInspectionItemId");
				}
			});
			
		});
		$("#FirstLevelInspectionItemId").change();
	});
</script>
<script type="text/javascript" >
$("#sm").click(function() {
	var name = $("#name").val();
	var FirstLevel = $("#FirstLevelInspectionItemId").val();
	var SecondLevel = $("#SecondLevelInspectionItemId").val();

	if(name == "") {
		alert("请输入项目名称");
		return false;	
	}	
	if(FirstLevel == "") {
		alert("请选择一级项目")
		return false;	
	}	
	if(SecondLevel == "") {
		alert("请选择二级项目");
		return false;	
	}
});
</script>
  </body>
</html>